package queue

import "cd-crawler/types"

type RequestQueue struct {
	RequestChan chan types.UrlRequest
}

// 添加url
func (u *RequestQueue) Push(r types.UrlRequest) {
	//fmt.Printf("urlManager;%+v\n", r)
	u.RequestChan <- r
}

// 取出url
func (u *RequestQueue) Pop() types.UrlRequest {
	return <-u.RequestChan
}
